<template>
	<web-view :src="pageUrl" @message="handleGetMessage"></web-view>
</template>

<script setup>
	import {
		onLoad
	} from '@dcloudio/uni-app';
	import {
		reactive,
		toRefs
	} from "vue";

	const state = reactive({
		pageUrl: ""
	});

	const {
		pageUrl
	} = toRefs(state);
	
	function handleGetMessage(e) {
		console.log("收到消息", e)
	}

	onLoad((option) => {
		pageUrl.value = option.url;
	})
</script>